package xm.erzhan.utils;

public enum ResourceEnum {
    farmland("farmland", "food"),
    steelmill("steelmill", "steel"),
    oilfield("oilfield", "oil"),
    mine("mine", "mine")
    ;

    private String type;
    private String value;

    ResourceEnum(String type, String value) {
        this.type = type;
        this.value = value;
    }

    public String getType() {
        return type;
    }


    public String getValue() {
        return value;
    }

    static public String getValueByType(String type) {

        String code = "";

        for (ResourceEnum c : ResourceEnum.values()) {
            if (type.equals(c.getType())) {
                code = c.getValue();
                break;
            }
        }

        return code;
    }


}
